home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / findutils.postinst < prev    next >
Text File  |  2009-06-15  |  1KB  |  40 lines

  1. #! /bin/sh
  2. set -e
  3.  
  4. if [ "$1" = "configure" ]; then
  5.   # up to 4.1.7-2 locatedb was in non-FHS-dir /var/lib/locate
  6.   if dpkg --compare-versions "$2" le-nl "4.1.7-2" ; then
  7.     if [ -f /var/lib/locate/locatedb ]; then
  8.       mv /var/lib/locate/locatedb /var/cache/locate/
  9.       rmdir /var/lib/locate 2>/dev/null || true
  10.     fi
  11.   fi
  12.   # Remove locatedb if we are upgrading from findutils with included locate.
  13.  
  14.   # Sadly it does not really work to *not* do this if locate is going to be
  15.   # installed. "apt-get install locate" will first completely upgrade
  16.   # findutils (including running this script) before even _unpacking_ locate.
  17.   # Therefore # dpkg-query -W -f='${Status}'locate will be
  18.   # "something ok not-installed" when this script is run.
  19.  
  20.   if [ -d /var/cache/locate/ ] && \
  21.   dpkg --compare-versions "$2" le-nl "4.2.31-1" && \
  22.   locatestatus=`dpkg-query -W -f='${Status}' locate 2> /dev/null` ; then
  23.     locatestatus=`echo $locatestatus | cut -f3 -d\ `
  24.     case "$locatestatus" in
  25.       not-installed | config-files)
  26.         rm -f /var/cache/locate/locatedb
  27.         rmdir --ignore-fail-on-non-empty /var/cache/locate/
  28.       ;;
  29.     esac
  30.   fi
  31. fi
  32.  
  33. # Automatically added by dh_installinfo
  34. if [ "$1" = "configure" ]; then
  35.     install-info --quiet /usr/share/info/find.info
  36. fi
  37. # End automatically added section
  38.  
  39. # vim:tabstop=2:expandtab:shiftwidth=2
  40.